#pragma once
#include <stdint.h>
#include "registercenter.hpp"

#if (!defined(ROCK_LIB) && !defined(ROCK_LINUX_PLATFORM))
// ROCK is used as DLL
#define ROCK_DLLEXPORT __declspec(dllexport) 
#define ROCK_DLLIMPORT __declspec(dllimport) 
#else 
#define ROCK_DLLEXPORT 
#define ROCK_DLLIMPORT
#endif

#ifdef ROCK_TEL_EXPORTS
#define ROCK_TEL_API ROCK_DLLEXPORT  
#else 
#define ROCK_TEL_API ROCK_DLLIMPORT 
#endif


/////////// global functions //////////
void ROCK_TEL_API telPrint(char *szFormat, ...);
void ROCK_TEL_API telPrint(const char* msg);

void telPrint2()
{
    telPrint("\r\n");
}

template <class T, class ...Args>
void telPrint2(T head, Args... rest)
{
    std::stringstream ss;
    ss << head << " ";
    telPrint(ss.str().c_str());
    ss.clear();
    telPrint2(rest...);
}

////////////////////////////////////////
class TelnetServerImpl;
class RegCenter;
class ROCK_TEL_API TelnetServer
{
public:
    TelnetServer();
    ~TelnetServer();
    void start();
    void stop();
    static RegCenter* regist;

private:
    TelnetServerImpl * _pImpl;
};

